package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.domain.SysStudentRankHistory;
import com.ruoyi.system.mapper.SysStudentRankHistoryMapper;
import com.ruoyi.system.service.SysStudentRankHistoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 系统-学生段位历史Service实现类
 */
@Service
public class SysStudentRankHistoryServiceImpl extends ServiceImpl<SysStudentRankHistoryMapper, SysStudentRankHistory> implements SysStudentRankHistoryService {

    @Resource
    private SysStudentRankHistoryMapper sysStudentRankHistoryMapper;

    @Override
    public List<SysStudentRankHistory> getRankHistoryByTime(Long userId, Date startTime, Date endTime) {
        return sysStudentRankHistoryMapper.selectRankHistoryByUserIdAndTime(userId, startTime, endTime);
    }

    @Override
    public List<Map<String, Object>> countRankChange(Long userId) {
        return sysStudentRankHistoryMapper.countRankChangeByUserId(userId);
    }
}